package com.fis.mca.client;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

import com.fis.mca.config.Config;
import com.fis.mca.config.ConfigConstant;
import com.fis.mca.language.LanguageTransferer;
import com.fis.mca.language.LanguageTransfererService;
import com.fis.mca.language2.LanguageTransferer2;
import com.fis.mca.language2.LanguageTransferer2Service;

public class Language2ServiceClient
{
	private static final QName SERVICE_NAME = new QName("http://language2.mca.fis.com/", "LanguageTransferer2Service");
    private static final String WSDL_URL = Config.getURL(ConfigConstant.LANGUAGE2_PORT_KEY);
	
    static LanguageTransferer2Service ss ;
    static LanguageTransferer2 port;  
	
	private Language2ServiceClient(){}
	
	static
	{
		URL url = null;
		try
		{
			url = new URL(WSDL_URL);
		}
		catch (MalformedURLException e)
		{
			java.util.logging.Logger
					.getLogger(LanguageTransferer.class.getName())
					.log(java.util.logging.Level.INFO,
							"Can not initialize the default wsdl from {0}",
							WSDL_URL);
		}
		
		ss = new LanguageTransferer2Service(url, SERVICE_NAME);
		port = ss.getLanguageTransferer2Port();
	}
	
	public static LanguageTransferer2 getService()
	{
		return port;
	}
}
